from mysql_utils import *

def get_all_keywords():
    mysql = MyPymysqlPool('dbMysql')
    query = "SELECT keyword FROM keywords"
    result = mysql.getAll(query)
    mysql.dispose()
    return result

keywords = get_all_keywords()
with open("userdict.txt", "w", encoding="utf-8") as f:
    for keyword in keywords:
        f.write(keyword['keyword'] + "\n")
